<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
    <title>Getting Started</title>
    <link rel="stylesheet" href="/assets/css/bootstrap.min.css">
    <link rel="stylesheet" href="/assets/fonts/ionicons.min.css">
    <link rel="stylesheet" href="/assets/css/Footer-Clean.css">
    <link rel="stylesheet" href="/assets/css/Navigation-with-Button.css">
    <link rel="stylesheet" href="/assets/css/swiper-bundle.min.css">
    <link rel="stylesheet" href="/assets/css/style.css">


    <link th:href="@{/css/bootstrap.min.css}" rel="stylesheet">
    <link th:href="@{/css/font-awesome.css}" rel="stylesheet">

    <!-- Data Tables -->
    <link th:href="@{/css/plugins/dataTables/dataTables.bootstrap.css}"
          rel="stylesheet">
    <link th:href="@{/css/animate.css}" rel="stylesheet">
    <link th:href="@{/css/style.css}" rel="stylesheet">
    <script src="/assets/js/jquery.min.js"></script>
    <script src="/assets/js/bootstrap.min.js"></script>
</head>

<body>



    <img src="/assets/img/logo.png" width="100%">
    <div>
        <nav class="navbar navbar-light navbar-expand-md navigation-clean-button" style="background:#C40305;">
            <div class="container">
                <div style="margin-right: 60px;">
                    <a class="navbar-brand" href="#">党支部</a>
                    <button data-toggle="collapse" class="navbar-toggler" data-target="#navcol-1">
                        <span class="sr-only">Toggle navigation</span>
                        <span class="navbar-toggler-icon"></span>
                    </button>
                </div>

                <div class="collapse navbar-collapse" id="navcol-1">
                    <ul class="nav  navbar-nav mr-auto" data-in="fadeInDown" data-out="fadeOutUp">
                        <li class="nav-item" role="presentation">
                            <a class="nav-link" style="width:150px;margin-right: -20px;" href="/index2">首页</a>
                        </li>
                        <li class="dropdown nav-item">
                            <a class="dropdown-toggle nav-link" data-toggle="dropdown" aria-expanded="false" href="#" style="width:150px;"> 第一支部</a>
                            <ul class="dropdown-menu sidebar" role="menu" style="background:red;min-width:100%;border:none;">
                                <li><a class="dropdown-item" role="presentation" href="#">低年级</a></li>
                                <li><a class="dropdown-item" role="presentation" href="#">大四</a></li>
                                <li><a class="dropdown-item" role="presentation" href="#">研究生</a></li>
                            </ul>
                        </li>
                        <li class="dropdown nav-item">
                            <a class="dropdown-toggle nav-link" data-toggle="dropdown" aria-expanded="false" href="#" style="width:150px;"> 第二支部</a>
                            <ul class="dropdown-menu sidebar" role="menu" style="background:red;min-width:100%;border:none;">
                                <li><a class="dropdown-item" role="presentation" href="#">低年级</a></li>
                                <li><a class="dropdown-item" role="presentation" href="#">大四</a></li>
                                <li><a class="dropdown-item" role="presentation" href="#">研究生</a></li>
                            </ul>
                        </li>
                        <li class="dropdown nav-item">
                            <a class="dropdown-toggle nav-link" data-toggle="dropdown" aria-expanded="false" href="#" style="width:150px;"> 第三支部</a>
                            <ul class="dropdown-menu sidebar" role="menu" style="background:red;min-width:100%;border:none;">
                                <li><a class="dropdown-item" role="presentation" href="#">低年级</a></li>
                                <li><a class="dropdown-item" role="presentation" href="#">大四</a></li>
                                <li><a class="dropdown-item" role="presentation" href="#">研究生</a></li>
                            </ul>
                        </li>
                        <li class="dropdown nav-item">
                            <a class="dropdown-toggle nav-link" data-toggle="dropdown" aria-expanded="false" href="#" style="width:150px;"> 第四支部</a>
                            <ul class="dropdown-menu sidebar" role="menu" style="background:red;min-width:100%;border:none;">
                                <li><a class="dropdown-item" role="presentation" href="#">低年级</a></li>
                                <li><a class="dropdown-item" role="presentation" href="#">大四</a></li>
                                <li><a class="dropdown-item" role="presentation" href="#">研究生</a></li>
                            </ul>
                        </li>
                        <li class="nav-item" role="presentation">
                            <a class="nav-link active" style="width:150px;margin-right: -20px;" href="#">党建活动</a>
                        </li>
                    </ul>
                </div>
            </div>
        </nav>
    </div>

    <div class="container">

        <div class="wrapper wrapper-content animated fadeInRight">
            <div class="row">
                <div class="col-sm-12">
                    <div class="ibox float-e-margins">
                        <div class="ibox-title" >
                            <h5 >活动列表</h5>
                        </div>
                        <div class="ibox-content" >
                            <div>
                                <form method="get" th:action="@{/index/selectAllActivities2}"  id="searchform">
                                    <div class="col-sm-2" style="margin: 20px">
                                        <input style="width:100%"  type="text" placeholder="发起人" class="form-control" name="activityAuthor" th:value="${activityAuthor}"/>
                                    </div>
                                    <div class="col-sm-2" style="margin: 20px">
                                        <input style="width:100%" type="text" placeholder="活动内容" class="form-control"  name="activityContent" th:value="${activityContent}">
                                    </div>
                                    <div class="col-sm-2" style="margin: 20px">
									<span class="input-group-btn">
										<input style="width:100%" type="submit" value="搜索" class="btn btn-danger ">
									</span>
                                    </div>
                                </form>

                            </div>


                            <table class="table table-striped table-bordered table-hover dataTables-example" >
                                <thead  >
                                    <tr class="text-center" >
                                        <td>标号</td>
                                        <td>活动发起人</td>
                                        <td>活动内容</td>
                                        <td>开始时间</td>
                                        <td>截止时间</td>
                                        <td>活动完成者</td>
                                        <td>完成者学号</td>
                                        <td>状态</td>
                                        <td>是否接受</td>
                                    </tr>
                                </thead>
                                <tbody>
                                <!--以下代码需修改 -->
                                <tr class="gradeA text-center"  th:each="activity:${pageInfo.list}" >
                                    <td th:text="${activityStat.index}">标号</td>
                                    <td th:text="${activity.activityAuthor}">发起者</td>
                                    <td th:text="${activity.activityContent}">活动内容</td>


                                    <td th:if="${#dates.format(activity.activityBeginDate,'yyyy-MM-dd')}!=null">
                                        <span>[[${#dates.format(activity.activityBeginDate,'yyyy-MM-dd')}]]</span>
                                    </td>
                                    <td th:unless="${#dates.format(activity.activityBeginDate,'yyyy-MM-dd')}!=null">
                                        <span>无</span>
                                    </td>

                                    <td th:if="${#dates.format(activity.activityEndDate,'yyyy-MM-dd')}!=null">
                                        <span>[[${#dates.format(activity.activityEndDate,'yyyy-MM-dd')}]]</span>
                                    </td>
                                    <td th:unless="${#dates.format(activity.activityEndDate,'yyyy-MM-dd')}!=null">
                                        <span>无</span>
                                    </td>

                                    <td th:text="${activity.activityUser?.userName}">用户</td>
                                    <td th:text="${activity.activityUser?.userId}">用户ID</td>

                                    <td th:switch="${activity.activityState}">
                                        <span th:case="0">未接收</span>
                                        <span th:case="1">已接收</span>
                                        <span th:case="2">已完成</span>
                                    </td>

                                    <td>
                                        <a  class="btn btn-danger btn-xs" th:if="${activity.activityState}==0"
                                            th:href="@{'/activity/updateActivityState0_1?activityId='+${activity.activityId}
                                            +'&activityUserId='+${session.user.userId}}">
                                            接收
                                        </a>
                                        <a  class="btn btn-danger btn-xs" th:if="${activity.activityState}!=0" disabled="" >
                                            不可接收
                                        </a>
                                    </td>
                                </tr>
                                <!--以上代码需修改 -->
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <!--显示分页信息-->
                    <div class="modal-footer no-margin-top">
                        <div class="col-md-6">
                            当前第 [[${pageInfo.pageNum}]]页,共 [[${pageInfo.pages}]] 页.一共 [[${pageInfo.total}]] 条记录
                        </div>

                        <ul class="pagination pull-right no-margin">
                            <li th:if="${pageInfo.hasPreviousPage}">
                                <a th:href="'/index/selectAllActivities2?pageNum=1'">首页</a>
                            </li>

                            <li class="prev" th:if="${pageInfo.hasPreviousPage}">
                                <a th:href="'/index/selectAllActivities2?pageNum='+${pageInfo.prePage}">
                                    <<
                                </a>
                            </li>
                            <!--遍历条数-->
                            <li th:each="nav:${pageInfo.navigatepageNums}">
                                <a th:href="'/index/selectAllActivities2?pageNum='+${nav}" th:text="${nav}" th:if="${nav != pageInfo.pageNum}"></a>
                                <span style="font-weight: bold;background: #F05151; color: white" th:if="${nav == pageInfo.pageNum}" th:text="${nav}" ></span>
                            </li>

                            <li class="next" th:if="${pageInfo.hasNextPage}">
                                <a th:href="'/index/selectAllActivities2?pageNum='+${pageInfo.nextPage}">
                                    >>
                                </a>
                            </li>

                            <li>
                                <a th:href="'/index/selectAllActivities2?pageNum='+${pageInfo.pages}">尾页</a>
                            </li>
                        </ul>
                    </div>

                </div>
            </div>
        </div>

    </div>

    <div class="footer-clean" style="background-color: red;color: white;">
        <footer>
            <div class="container">
                <div class="row justify-content-center">
                    <div class="col-sm-4 col-md-3 item">
                        <h3>校内处室</h3>
                        <ul>
                            <li><a href="#">教务处</a></li>
                            <li><a href="#">党委教师工作部</a></li>
                            <li><a href="#">学科建设与学位办公室</a></li>
                        </ul>
                    </div>
                    <div class="col-sm-4 col-md-3 item">
                        <h3>联盟</h3>
                        <ul>
                            <li><a href="#">示范性软件学院联盟</a></li>
                            <li><a href="#">中国软件行业学会</a></li>
                            <li><a href="#">信息技术新工科产学研联盟</a></li>
                        </ul>
                    </div>
                    <div class="col-sm-4 col-md-3 item">
                        <h3>学会</h3>
                        <ul>
                            <li><a href="#">科研院</a></li>
                            <li><a href="#">学生工作处（部） success</a></li>
                            <li><a href="#">中国计算机学会</a></li>
                        </ul>
                    </div>
                    <div class="col-lg-3 item social"><a href="#"><i class="icon ion-social-facebook"></i></a><a href="#"><i class="icon ion-social-twitter"></i></a><a href="#"><i class="icon ion-social-snapchat"></i></a><a href="#"><i class="icon ion-social-instagram"></i></a>
                        <p class="copyright">
                            版权所有：中北大学 <br>地址：山西省太原市学院路3号</p>
                    </div>
                </div>
            </div>
        </footer>
    </div>




    <!-- 全局js -->
    <script th:src="@{/js/jquery.min.js}"></script>
    <script th:src="@{/js/bootstrap.min.js}"></script>
    <script th:src="@{/js/plugins/jeditable/jquery.jeditable.js}"></script>

    <!-- Data Tables -->
    <script th:src="@{/js/plugins/dataTables/jquery.dataTables.js}"></script>
    <script th:src="@{/js/plugins/dataTables/dataTables.bootstrap.js}"></script>

    <!-- 自定义js -->
    <script th:src="@{/js/content.js}"></script>


</body>

</html>